// checkterr.txt 
// by Thralni
// version 1.0.0

// This very simple script waits until a specific terrain, placed on the spot this same terrain script sits, changes in an other terrain, this script
// checks whether the terrain in which it has changes matches the terrain number which you predefined. 
// When it is the same, it sets a flag you entered in a memory cell.

// Memory Cells - 
//   0 - number of terrain this scipt checks to be there.
//   1,2 - SDF to be set when terrain entered at memory cell 0 is there.

beginterrainscript; 

variables;

body;

beginstate INIT_STATE;
break;

beginstate START_STATE;

if (get_terrain(my_loc_x(),my_loc_y()) == get_memory_cell(0)) {
		set_flag(get_memory_cell(1),get_memory_cell(2),1);
		}
break;

beginstate SEARCH_STATE;
break;
